package com.qingcloud.adminbackend.enums;

public enum TriggerTypeEnum {

    ONE(1, "直接映射"),
    TWO(2, "定时触发"),
    THREE(3, "事件监听");

    private Integer code;

    private String name;

    private TriggerTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        TriggerTypeEnum[] uss = values();
        for (TriggerTypeEnum us : uss) {
            if (us.code == code) {
                return us.name;
            }
        }
        return null;
    }
}
